﻿<Window x:Class="gsview.PageExtractSave"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Extract/Rearrange Pages" Height="306" Width="282">

    <DockPanel LastChildFill="True">
        <Grid x:Name="xaml_PageGrid" Width="100" Background="DarkGray" DockPanel.Dock="Left" Visibility="Visible">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <TextBlock Grid.Column="0" Grid.Row="0"  Margin="15,0,0,0">
                <Bold>Pages:</Bold>
            </TextBlock>
            <ListView Grid.Column="0" Grid.Row="1"  x:Name="xaml_PageList" HorizontalAlignment="Stretch" 
                    ScrollViewer.CanContentScroll="False" 
                    Background="White" Margin="10,5,10,10"
                      PreviewMouseLeftButtonDown="ExtractLeftButtonDown" PreviewMouseLeftButtonUp="ExtractLeftButtonUp"
                      PreviewMouseMove="ExtractMouseMove" MouseLeave="ExtractMouseLeave" PreviewMouseRightButtonDown="RightButtonDown">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Margin="5,5,0,0" HorizontalAlignment="Left">
                            <TextBlock TextWrapping="Wrap" Text="{Binding PageString}" FontFamily="Segoe UI" FontSize="11" />
                        </StackPanel>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </Grid>

        <Grid Background="DarkGray" Grid.Row="0" Grid.Column="1" Margin="0,0,0,0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Button  Grid.Column="0" Grid.Row="0" Width="70" Height="20" Name="xaml_AllPages" Click="AllPages" Margin="0,40,0,0">
                <TextBlock>All Pages</TextBlock>
            </Button>
            <Button  Grid.Column="0" Grid.Row="1" Width="70" Height="20" Name="xaml_EvenPages" Click="EvenPages" Margin="0,5,0,0">
                <TextBlock>Even Pages</TextBlock>
            </Button>
            <Button  Grid.Column="0" Grid.Row="2" Width="70" Height="20" Name="xaml_OddPages" Click="OddPages" Margin="0,5,0,0">
                <TextBlock>Odd Pages</TextBlock>
            </Button>
            <Button  Grid.Column="0" Grid.Row="3" Width="70" Height="20" Name="xaml_ReversePages" Click="Reverse" Margin="0,5,0,0">
                <TextBlock>Reverse</TextBlock>
            </Button>
            <Button  Grid.Column="0" Grid.Row="4" Width="70" Height="20" Name="xaml_Extract" Click="ExtractPages" Margin="0,20,0,0">
                <TextBlock>Extract</TextBlock>
            </Button>
            <TextBlock Grid.Column="0" Grid.Row="5"  Margin="0,20,0,0"> Use drag/drop to rearrange. <LineBreak /> Right click to delete from list. 
            <LineBreak /> Only selected pages extracted. </TextBlock>                
            </Grid>
    </DockPanel>
</Window>
